const ROOT_PATH = require('app-root-path').path; //项目根路径
const path = require('path');
const router = require('koa-router')();
const userServe = require(path.join(ROOT_PATH , '/service/user_serve'));

router.prefix('/api/user'); //路由前缀 /api/user/xxx访问

router.get('/test', async (ctx, next) => {
	const data = await userServe.test();
	ctx.body = data;
});

router.get('/person', async (ctx, next) => {
	const data = await userServe.person();
	ctx.body = data;
});

module.exports = router;